@{
    ViewBag.Title = "IP黑白名单";
}
@section head{
   <link href="@Url.Content("~/Content/Images/UploadIcons/icons.css")" rel="stylesheet" type="text/css" />
   <script type="text/javascript">
       $(document).ready(function () {
           $('.btnSearch').click(function () {
               mainSearch('.search_box :input');
           }).click();
       });
       function on_close(key) {
           $('#details').datagrid('reload'); 
       }
       function onDeleteData() {
           $('#details').datagrid('reload');
       }
       function Typeformat(value, row, index) {
           var type = new Array('1:黑名单', '2:白名单');
           return type[value - 1] + '';
       }
       function Statusformat(value, row, index) {
           var status = new Array('1:启用', '2:停用');
           return status[value - 1] + '';
       }
   </script>
}
@section body{
<body>
<div class="easyui-layout" data-options="fit:true">
    <div region="north" border="false">
        <div class="navigation">
            <div class="left">
                @ViewBag.CurrentPath
            </div>
        </div>
        <div class="tools_box">
	        <div class="tools_bar">
                <div class="left">
                   <a href="javascript:search_click()" id="search" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true ">查询</a>  
                   <a href="javascript:show_fullscreen_dialog(serverUrl.add ,on_close,'add')" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true ">添加</a>  
                   <a href="javascript:DeleteSelecteds($('#details').datagrid('getSelections'),'id',onDeleteData)" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">批量删除</a>
                </div>
            </div>
            <div class="search_box">
                类型:<select name="Type"  class="txtSearchInput" style="width:90px;">
                        <option value=""></option>
                        <option value="1">1:黑名单</option>
                        <option value="2">2:白名单</option>
                     </select>
			    起始IP：<input type="text" name="BeginIP" class="txtSearchInput" />
                结束IP：<input type="text" name="BeginIP" class="txtSearchInput" />
                <input type="submit" value="查询" class="btnSearch"/>
		    </div>
        </div>
    </div> 
    <div region="center" border="false">
        <table class="easyui-datagrid" id="details" data-options="fit:true,rownumbers:true,singleSelect:false,
          pagination:true,border:true,url:serverUrl.list">
           <thead data-options="frozen:true"> 
              <tr>
                   <th data-options="field:'id',checkbox:true"></th>
              </tr>
           </thead>
           <thead>  
               <tr>  
                   <th data-options="field:'Type',sortable:true,width:80,formatter:Typeformat">类型</th>
                   <th data-options="field:'BeginIP',sortable:true,width:120">起始IP</th>
                   <th data-options="field:'EndIP',sortable:true,width:120">结束IP</th>
                   <th data-options="field:'Status',sortable:true,width:80,formatter:Statusformat">状态</th>
                   <th data-options="field:'Memo',sortable:true,width:200">备注</th>
                   <th data-options="field:'cmd',width:100,align:'center',formatter:IDcmdformat">操作</th>
               </tr>  
           </thead>  
        </table>
    </div>
</div>
</body>
}